/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tp2ia_partie2.objects;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 *
 * @author hp
 */
public class ButClause extends Clause {

    public ButClause(Set<Litteral> litteraux) {
        super(litteraux);
        Set<Litteral> l = new LinkedHashSet<Litteral>();
        for (Litteral lit : litteraux) {
            Litteral tmpl = new Litteral(lit.getC());
            tmpl.setStatutValue(false);
            l.add(tmpl);
        }
        this.litteraux = l;
    }

    public ButClause(Litteral let) {
        super(null);
        Set<Litteral> litteraux = new LinkedHashSet<Litteral>();
        litteraux.add(let);
        Set<Litteral> l = new LinkedHashSet<Litteral>();
        for (Litteral lit : litteraux) {
            Litteral tmpl = new Litteral(lit.getC());
            tmpl.setStatutValue(false);
            l.add(tmpl);
        }
        this.litteraux = l;
    }

    @Override
    public String toString() {
        String msg = "ButClause{ (";
        for (Litteral lit : litteraux) {
            msg += " ¬" + lit.getC() + ",";
        }
        return msg + " )?";
    }

}
